// 当前环境
const ENV = process.env.NODE_ENV
// 基本请求
let _BASE_URL = ''
// 搜索模块链接
let _SEARCH_BASE_URL = ''
// 前台路径
let _FONT_BASE_URL = ''
// 前台跳转路径
let _FONT_GOODS_DETAIL_URL = ''
// 预览跳转链接
let _FONT_TEST_GOODS_DETAIL_URL = ''

// 当前环境判断 测试环境
if (ENV == 'development' || ENV == 'preannouncement') {
  _BASE_URL = 'http://192.168.2.24:8081/HaoXiaDanStoreBgApi/'
  // _BASE_URL = 'http://apiStore.hxd.ughen.cn/HaoXiaDanStoreBgApi/'
  _SEARCH_BASE_URL = 'http://apiWeb.hxd.ughen.cn/MallLucene/'
  _FONT_BASE_URL = 'http://apiWeb.hxd.ughen.cn/TermireMall/'
  _FONT_GOODS_DETAIL_URL = 'http://web.hxd.ughen.cn/goods/detail/'
  _FONT_TEST_GOODS_DETAIL_URL = 'http://web.hxd.ughen.cn/goods/detail/'
} else if (ENV == 'production') { // 生产环境
  // 正式环境
  _BASE_URL = 'http://shopapi.haoxiadan.cn/ShopApi/'
  _SEARCH_BASE_URL = 'https://api.haoxiadan.cn/Lucene/'
  _FONT_BASE_URL = 'https://api.haoxiadan.cn/MallApi/'
  _FONT_GOODS_DETAIL_URL = 'https://www.haoxiadan.cn/goods/detail/'
  _FONT_TEST_GOODS_DETAIL_URL = 'https://www.haoxiadan.cn/goods/detail/'
}

export const BASE_URL = _BASE_URL
export const SEARCH_BASE_URL = _SEARCH_BASE_URL
export const FONT_BASE_URL = _FONT_BASE_URL
export const FONT_GOODS_DETAIL_URL = _FONT_GOODS_DETAIL_URL
export const FONT_TEST_GOODS_DETAIL_URL = _FONT_TEST_GOODS_DETAIL_URL

export const API = `${BASE_URL}api/web/store/v3/`
//好下单3.0版
export const API4 = `${BASE_URL}v3/` // 订单最新版
export const API_FRONT = `${FONT_BASE_URL}api/h5/v2/`
export const API_SEARCH = `${SEARCH_BASE_URL}api/h5/v2/`
export const FONT_API = `${FONT_BASE_URL}api/h5/v2/`
export const SEARCH_API = `${SEARCH_BASE_URL}api/h5/v2/`

// 图片上传地址
export const imgUploadUrl = `${API}goods/uploadGoodsImage`

// file上传地址
export const fileUploadUrl = `${API}goods/goodsExcelImport`

// 加密的秘钥
export const KEY = 'HAOXIADANURLKEY'